import Vue from 'vue/dist/vue.esm'

console.log(Vue)

const vm = new Vue({
  el: '#app',
  data: {
    msg: 'abc'
  },
  computed: {
    length () {
      console.log('计算属性 length')
      return this.msg.length
    }
  },
  watch: {
    msg (value) {
      console.log('msg变了', value)
    }
  },
  methods: {
    update () {
      this.msg += '--'
    }
  },
  render: function(h) {
    console.log(h)
    let vnode = (
      <div>
        <p>msg: {this.msg}</p>
        <p>length: {this.length}</p>
        <button onClick={this.update}>更新</button>
      </div>
    )
    return vnode
  }
})
console.log(vm)